package Frames;

import Classes.Cliente;
import Classes.GeradoRelatorios;
import Classes.Recibo;
import Classes.Servico;
import Classes_Conexao.ClienteDAO;
import Classes_Conexao.ReciboDAO;
import Classes_Conexao.ServicoDAO;
import java.awt.Dimension;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.DefaultTableModel;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.view.JasperViewer;
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
import org.pushingpixels.substance.api.skin.OfficeSilver2007Skin;
import org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel;

/**
 *
 * @author Saulo Queiroz
 */
public class ReciboSaida extends javax.swing.JInternalFrame {

    Servico servico = new Servico();
    Cliente cliente = new Cliente();
    Recibo recibo = new Recibo();
    Date data;
    private DefaultTableModel modelo = null;
    private DefaultTableModel modeloServ = null;
    private DefaultTableModel modeloServRealizado = null;

    public ReciboSaida() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnIncluir = new javax.swing.JButton();
        btnLocalizar = new javax.swing.JButton();
        btnExcluir = new javax.swing.JButton();
        btnGravar = new javax.swing.JButton();
        btnNaoGravar = new javax.swing.JButton();
        btnImprimir = new javax.swing.JButton();
        btnFechar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        txtCodigo = new javax.swing.JFormattedTextField();
        btnServico = new javax.swing.JButton();
        dadosServico = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        txtCliente = new javax.swing.JTextField();
        txtTelefone = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        txtCelular = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        txtEquipamento = new javax.swing.JTextField();
        txtDataSaida = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        txtEndereco = new javax.swing.JTextField();
        txtCidade = new javax.swing.JTextField();
        txtBairro = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        txtDataEntrada = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        txtCodigoCliente = new javax.swing.JTextField();
        dadosServico2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        btnAdd = new javax.swing.JButton();
        btnDelete = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        txtTotal = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        txtTecnico = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        cBoxStatus = new javax.swing.JComboBox();
        LocalizarServico = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        cPesquisaServ = new javax.swing.JComboBox();
        jScrollPane4 = new javax.swing.JScrollPane();
        jScrollPane5 = new javax.swing.JScrollPane();
        TabelaServ = new javax.swing.JTable();
        jPanel5 = new javax.swing.JPanel();
        txtPesquisaNome = new javax.swing.JTextField();
        jScrollPane6 = new javax.swing.JScrollPane();
        jScrollPane7 = new javax.swing.JScrollPane();
        TabelaServRealizado = new javax.swing.JTable();

        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameOpened(evt);
            }
        });

        btnIncluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/New-icon.png"))); // NOI18N
        btnIncluir.setText("Incluir");
        btnIncluir.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnIncluir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnIncluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIncluirActionPerformed(evt);
            }
        });

        btnLocalizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Search-icon.png"))); // NOI18N
        btnLocalizar.setText("Localizar");
        btnLocalizar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnLocalizar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnLocalizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLocalizarActionPerformed(evt);
            }
        });

        btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Delete-icon.png"))); // NOI18N
        btnExcluir.setText("Excluir");
        btnExcluir.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnExcluir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExcluirActionPerformed(evt);
            }
        });

        btnGravar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Save-icon.png"))); // NOI18N
        btnGravar.setText("Gravar");
        btnGravar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnGravar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnGravar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGravarActionPerformed(evt);
            }
        });

        btnNaoGravar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Remove-icon.png"))); // NOI18N
        btnNaoGravar.setText("Não Gravar");
        btnNaoGravar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNaoGravar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNaoGravar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNaoGravarActionPerformed(evt);
            }
        });

        btnImprimir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Print-icon.png"))); // NOI18N
        btnImprimir.setText("Imprimir");
        btnImprimir.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnImprimir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnImprimir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirActionPerformed(evt);
            }
        });

        btnFechar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Log-Out-icon.png"))); // NOI18N
        btnFechar.setText("Fechar");
        btnFechar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnFechar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnFechar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFecharActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel1.setText("Codigo do Serviço:");

        btnServico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/lupa pequena.png"))); // NOI18N
        btnServico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnServicoActionPerformed(evt);
            }
        });

        dadosServico.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados do Serviço"));

        jLabel4.setText("Cliente");

        jLabel11.setText("Celular");

        jLabel2.setText("Telefone");

        txtDataSaida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtDataSaidaActionPerformed(evt);
            }
        });

        jLabel3.setText("Data e Hora da entrada");

        jLabel6.setText("Endereço");

        jLabel7.setText("Cidade");

        jLabel8.setText("Bairro");

        jLabel10.setText("Equipamento");

        jLabel5.setText("Data e Hora da Saida");

        jLabel15.setText("Cod. Cliente");

        javax.swing.GroupLayout dadosServicoLayout = new javax.swing.GroupLayout(dadosServico);
        dadosServico.setLayout(dadosServicoLayout);
        dadosServicoLayout.setHorizontalGroup(
            dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dadosServicoLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(dadosServicoLayout.createSequentialGroup()
                        .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(dadosServicoLayout.createSequentialGroup()
                                .addComponent(txtCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(6, 6, 6)
                                .addComponent(txtCodigoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(6, 6, 6)
                                .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(dadosServicoLayout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addGap(247, 247, 247)
                                .addComponent(jLabel15)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel2)))
                        .addGap(10, 10, 10)
                        .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel11)
                            .addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(dadosServicoLayout.createSequentialGroup()
                        .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtEquipamento, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))
                        .addGap(18, 18, 18)
                        .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtDataEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtDataSaida, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
                            .addComponent(jLabel5)))
                    .addGroup(dadosServicoLayout.createSequentialGroup()
                        .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(dadosServicoLayout.createSequentialGroup()
                                .addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(dadosServicoLayout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addGap(124, 124, 124)
                                .addComponent(jLabel7)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(98, Short.MAX_VALUE))
        );
        dadosServicoLayout.setVerticalGroup(
            dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dadosServicoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel2)
                        .addComponent(jLabel11)
                        .addComponent(jLabel15)))
                .addGap(6, 6, 6)
                .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCodigoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6)
                    .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(jLabel8)))
                .addGap(6, 6, 6)
                .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(6, 6, 6)
                .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addComponent(jLabel3)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(dadosServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtDataSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtEquipamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDataEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(46, Short.MAX_VALUE))
        );

        dadosServico2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"", "", "", ""}
            },
            new String [] {
                "Descrição", "Valor Unitário", "Quantidade", "Total"
            }
        ));
        jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTable1KeyReleased(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);

        btnAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Netvibes-icon.png"))); // NOI18N
        btnAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddActionPerformed(evt);
            }
        });

        btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Cute-Ball-Stop-icon.png"))); // NOI18N
        btnDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteActionPerformed(evt);
            }
        });

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 16));
        jLabel9.setText("Total:");

        jLabel13.setText("Tecnico Responsavel");

        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel14.setText("Status:");

        cBoxStatus.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Retirado", "Aberto", "Deposito" }));

        javax.swing.GroupLayout dadosServico2Layout = new javax.swing.GroupLayout(dadosServico2);
        dadosServico2.setLayout(dadosServico2Layout);
        dadosServico2Layout.setHorizontalGroup(
            dadosServico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dadosServico2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 374, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12)
                .addGroup(dadosServico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(dadosServico2Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtTotal, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE))
                    .addGroup(dadosServico2Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cBoxStatus, 0, 115, Short.MAX_VALUE))
                    .addComponent(jLabel13)
                    .addComponent(txtTecnico, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE))
                .addContainerGap())
        );
        dadosServico2Layout.setVerticalGroup(
            dadosServico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dadosServico2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(dadosServico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(dadosServico2Layout.createSequentialGroup()
                        .addGroup(dadosServico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnDelete)
                            .addComponent(btnAdd)
                            .addGroup(dadosServico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(cBoxStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel14)))
                        .addGap(5, 5, 5)
                        .addGroup(dadosServico2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9)
                            .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtTecnico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        LocalizarServico.setBorder(javax.swing.BorderFactory.createTitledBorder("Localizar"));
        LocalizarServico.setPreferredSize(new java.awt.Dimension(651, 227));

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Pesquisar por status"));

        cPesquisaServ.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Aberto", "Retirado", "Deposito" }));
        cPesquisaServ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cPesquisaServActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(cPesquisaServ, 0, 216, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(cPesquisaServ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(25, Short.MAX_VALUE))
        );

        jScrollPane4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jScrollPane4MouseClicked(evt);
            }
        });

        TabelaServ.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        TabelaServ.getTableHeader().setReorderingAllowed(false);
        TabelaServ.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                TabelaServMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                TabelaServMouseEntered(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                TabelaServMousePressed(evt);
            }
        });
        jScrollPane5.setViewportView(TabelaServ);

        jScrollPane4.setViewportView(jScrollPane5);

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Pesquisa Por Nome"));

        txtPesquisaNome.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtPesquisaNomeActionPerformed(evt);
            }
        });
        txtPesquisaNome.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtPesquisaNomeKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(txtPesquisaNome, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(txtPesquisaNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(25, Short.MAX_VALUE))
        );

        jScrollPane6.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jScrollPane6MouseClicked(evt);
            }
        });

        TabelaServRealizado.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        TabelaServRealizado.getTableHeader().setReorderingAllowed(false);
        TabelaServRealizado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                TabelaServRealizadoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                TabelaServRealizadoMouseEntered(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                TabelaServRealizadoMousePressed(evt);
            }
        });
        jScrollPane7.setViewportView(TabelaServRealizado);

        jScrollPane6.setViewportView(jScrollPane7);

        javax.swing.GroupLayout LocalizarServicoLayout = new javax.swing.GroupLayout(LocalizarServico);
        LocalizarServico.setLayout(LocalizarServicoLayout);
        LocalizarServicoLayout.setHorizontalGroup(
            LocalizarServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LocalizarServicoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(LocalizarServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(LocalizarServicoLayout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 670, Short.MAX_VALUE)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 357, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        LocalizarServicoLayout.setVerticalGroup(
            LocalizarServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LocalizarServicoLayout.createSequentialGroup()
                .addGroup(LocalizarServicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(58, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(dadosServico, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(btnIncluir)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnLocalizar)
                        .addGap(10, 10, 10)
                        .addComponent(btnExcluir)
                        .addGap(10, 10, 10)
                        .addComponent(btnGravar)
                        .addGap(10, 10, 10)
                        .addComponent(btnNaoGravar)
                        .addGap(10, 10, 10)
                        .addComponent(btnImprimir)
                        .addGap(10, 10, 10)
                        .addComponent(btnFechar, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addComponent(jLabel1)
                        .addGap(4, 4, 4)
                        .addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)
                        .addComponent(btnServico, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(dadosServico2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(LocalizarServico, javax.swing.GroupLayout.DEFAULT_SIZE, 702, Short.MAX_VALUE)
                    .addContainerGap()))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btnExcluir, btnFechar, btnGravar, btnImprimir, btnIncluir, btnLocalizar, btnNaoGravar});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnLocalizar)
                    .addComponent(btnExcluir)
                    .addComponent(btnGravar)
                    .addComponent(btnNaoGravar)
                    .addComponent(btnImprimir)
                    .addComponent(btnFechar)
                    .addComponent(btnIncluir))
                .addGap(11, 11, 11)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnServico, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(2, 2, 2)
                .addComponent(dadosServico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(36, 36, 36)
                .addComponent(dadosServico2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(126, 126, 126)
                    .addComponent(LocalizarServico, javax.swing.GroupLayout.PREFERRED_SIZE, 449, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(23, Short.MAX_VALUE)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnIncluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIncluirActionPerformed
//        if (btnLocalizar.getText().equals("Voltar")) {
//            btnLocalizar.setText("Localizar");
//            CadastroCliente.setVisible(true);
//            Localizar.setVisible(false);
//        } else {
//            btnLocalizar.setText("Localizar");
//            CadastroCliente.setVisible(true);
//            Localizar.setVisible(false);
//        }

        txtCodigo.setText("");
        txtBairro.setText("");
        txtCelular.setText("");
        txtCidade.setText("");
        txtCliente.setText("");
        txtDataEntrada.setText("");
        txtDataSaida.setText("");
        txtEndereco.setText("");
        txtEquipamento.setText("");
        txtTelefone.setText("");
        txtTotal.setText("");
        txtTecnico.setText("");
        txtCodigoCliente.setText("");
        modelo.removeRow(0);

        //desativar e ativar
        btnIncluir.setEnabled(false);
        btnLocalizar.setEnabled(false);
        btnExcluir.setEnabled(false);
        btnGravar.setEnabled(true);
        btnNaoGravar.setEnabled(true);
        btnFechar.setEnabled(false);
        btnAdd.setEnabled(true);
        btnDelete.setEnabled(true);
        btnServico.setEnabled(true);

        //ativar e desativar campos
        txtBairro.setEnabled(true);
        txtCelular.setEnabled(true);
        txtCidade.setEnabled(true);
        txtCliente.setEnabled(true);
        txtCodigo.setEnabled(false);
        txtDataEntrada.setEnabled(false);
        txtDataSaida.setEnabled(false);
        txtEndereco.setEnabled(true);
        txtEquipamento.setEnabled(true);
        txtTelefone.setEnabled(true);
        txtTotal.setEnabled(true);
        txtTecnico.setEnabled(true);
        cBoxStatus.setEnabled(true);
        txtCodigoCliente.setEnabled(false);
        jTable1.setEnabled(true);
        //mudar nomes dos botões
        btnGravar.setText("Gravar");
        //incluir uma linha para não causar um erro na instacia
        modelo.addRow(new String[][]{});
}//GEN-LAST:event_btnIncluirActionPerformed

    private void btnLocalizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLocalizarActionPerformed
//        if (btnLocalizar.getText().equals("Localizar")) {
//            btnLocalizar.setText("Voltar");
//            dadosServico.setVisible(false);
//            dadosServico2.setVisible(false);
//            LocalizarServico.setVisible(true);
//            btnIncluir.setEnabled(false);
//
//        } else {
//            btnLocalizar.setText("Localizar");
//            dadosServico.setVisible(true);
//            dadosServico2.setVisible(true);
//            LocalizarServico.setVisible(false);
//            btnIncluir.setEnabled(true);
//        }
//        btnExcluir.setEnabled(false);
//        btnGravar.setText("Gravar");
    }//GEN-LAST:event_btnLocalizarActionPerformed

    private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed
//        UIManager.put("OptionPane.yesButtonText", "Sim");
//        UIManager.put("OptionPane.noButtonText", "Não");
//        UIManager.put("OptionPane.cancelButtonText", "Cancelar");
//        int resultado = JOptionPane.showConfirmDialog(null, "Você deseja excluir o registro?", "Excluir", 1, 1);
//        int resultado2 = JOptionPane.showConfirmDialog(null, "Tem certeza?", "Excluir", 1, 1);
//        if (resultado == 0 && resultado2 == 0) {
//            int linhaSelecionada = jTable1.getSelectedRow();
//            Cliente cliente = new Cliente();
//
//            cliente.setNome(jTable1.getValueAt(linhaSelecionada, 1).toString());
//
//            try {
//                ClienteDAO clienteDao = new ClienteDAO();
//                clienteDao.excluir(cliente);
//            } catch (SQLException ex) {
//                ex.printStackTrace();
//            }
//            modelo.removeRow(linhaSelecionada);
//            // ativar e desativar os campos de texto
//            txtCodigo.setText("");
//            txtRazaoSocial.setText("");
//            txtNomeFantasia.setText("");
//            txtEndeco.setText("");
//            txtBairro.setText("");
//            txtCep.setText("");
//            txtCidade.setText("");
//            txtUf.setText("");
//            txtFone.setText("");
//            txtFax.setText("");
//            txtFone2.setText("");
//            txtCelular.setText("");
//            txtCnpj.setText("");
//            txtInscricaoEstadual.setText("");
//            txtAObs.setText("");
//            radioFisica.setSelected(false);
//            radioJuridica.setSelected(false);
//            boxAtivo.setSelected(true);
//            boxCliente.setSelected(true);
//            boxFornecedor.setSelected(false);
//            //ativar e desativar campos
//            txtAObs.setEnabled(false);
//            txtBairro.setEnabled(false);
//            txtCelular.setEnabled(false);
//            txtCep.setEnabled(false);
//            txtCidade.setEnabled(false);
//            txtCnpj.setEnabled(false);
//            txtCodigo.setEnabled(false);
//            txtEndeco.setEnabled(false);
//            txtFax.setEnabled(false);
//            txtFone.setEnabled(false);
//            txtFone2.setEnabled(false);
//            txtInscricaoEstadual.setEnabled(false);
//            txtNomeFantasia.setEnabled(false);
//            txtRazaoSocial.setEnabled(false);
//            txtUf.setEnabled(false);
//            radioFisica.setEnabled(false);
//            radioJuridica.setEnabled(false);
//            boxAtivo.setEnabled(false);
//            boxCliente.setEnabled(false);
//            boxFornecedor.setEnabled(false);
//            // desativar o botao excluir
//            btnExcluir.setEnabled(false);
//            JOptionPane.showMessageDialog(null, "Registro excluido com sucesso!");
//        } else {
//            return;
//        }
    }//GEN-LAST:event_btnExcluirActionPerformed

    private void btnGravarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGravarActionPerformed
//        if (btnGravar.getText() == "Atualizar") {
//            //alterar
//            int linhaSelecionada = jTable1.getSelectedRow();
//            Cliente cliente = new Cliente();
//
//            cliente.setCodigo(Integer.parseInt(jTable1.getValueAt(linhaSelecionada, 0).toString())); //"Aqui é para modificação do id (Não pode ser alterado.)"
//            cliente.setNome(txtRazaoSocial.getText());
//            cliente.setApelido(txtNomeFantasia.getText());
//            cliente.setCliente(Boolean.toString(boxCliente.isSelected()));
//            cliente.setFornecedor(Boolean.toString(boxFornecedor.isSelected()));
//            cliente.setAtivo(Boolean.toString(boxAtivo.isSelected()));
//            cliente.setTipoPessoa(jTable1.getValueAt(linhaSelecionada, 6).toString());
//            cliente.setEndereco(txtEndeco.getText());
//            cliente.setBairro(txtBairro.getText());
//            cliente.setCidade(txtCidade.getText());
//            cliente.setCep(txtCep.getText());
//            cliente.setUf(txtUf.getText());
//            cliente.setFone1(txtFone.getText());
//            cliente.setFone2(txtFone2.getText());
//            cliente.setFax(txtFax.getText());
//            cliente.setCelular(txtCelular.getText());
//            cliente.setCnpj(txtCnpj.getText());
//            cliente.setCgf(txtInscricaoEstadual.getText());
//            cliente.setObs(txtAObs.getText());
//
//            try {
//                ClienteDAO cDao = new ClienteDAO();
//                cDao.editar(cliente);
//
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
//            btnGravar.setEnabled(false);
//        } else {
        //adiciona

        if (txtTecnico.getText().equals("")) {
            JOptionPane.showMessageDialog(null, "O campo Tecnico responsavel não pode ficar em branco");
            txtTecnico.requestFocus();
            return;
        }

//        recibo.setDataSaida(txtDataSaida.getText());
//        recibo.setTotal(Double.parseDouble(txtTotal.getText()));
//        recibo.setTecnicoResponsavel(txtTecnico.getText());
////        recibo.setDescrição(modelo.getValueAt(1, 1).toString());
////        recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(1, 2).toString()));
////        recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(1, 3).toString()));
////        recibo.setSubtotal(Double.parseDouble(modelo.getValueAt(1, 4).toString()));
//
//
//        ReciboDAO dao = null;
//
//        try {
//            dao = new ReciboDAO();
//            dao.adiciona(recibo);
//            // se caso ocorrer um erro ele vai entrar no catch
//            txtTecnico.getText();
//            txtTotal.getText();
//            txtDataSaida.getText();
//        } catch (SQLException ex) {
//            System.err.print(ex.getMessage());
//            Logger.getLogger(ReciboSaida.class.getName()).log(Level.SEVERE, null, ex);
//        }
//        //fim adiciona
//        //ativo e não ativo


        btnNaoGravar.setEnabled(false);
        btnGravar.setEnabled(false);
        btnIncluir.setEnabled(true);
        btnLocalizar.setEnabled(true);
        btnImprimir.setEnabled(true);
        btnFechar.setEnabled(true);

        int linhaSelecionada = TabelaServ.getSelectedRow();

        //recibo.setCodigoServico(Integer.parseInt(TabelaServ.getValueAt(linhaSelecionada, 0).toString()));
        servico.setCodigoServico(Integer.parseInt(txtCodigo.getText()));
        servico.setDataHSaida(txtDataSaida.getText());
        servico.setTotal(Double.parseDouble(txtTotal.getText()));
        servico.setTecnicoResponsavel(txtTecnico.getText());
        servico.setStatus(cBoxStatus.getSelectedItem().toString());

        try {
            ReciboDAO rDao = new ReciboDAO();
            rDao.editar(servico);

        } catch (Exception e) {
            e.printStackTrace();
        }
        if (modelo.getRowCount() == 1) {
            recibo.setCodigoServico(Integer.parseInt(txtCodigo.getText()));
            recibo.setDescrição(modelo.getValueAt(0, 0).toString());
            recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(0, 1).toString()));
            recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(0, 2).toString()));
            recibo.setSubtotal(Double.parseDouble(modelo.getValueAt(0, 3).toString()));

        } else if (modelo.getRowCount() == 2) {
            recibo.setCodigoServico(Integer.parseInt(txtCodigo.getText()));
            recibo.setDescrição(modelo.getValueAt(0, 0).toString());
            recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(0, 1).toString()));
            recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(0, 2).toString()));
            recibo.setSubtotal(Double.parseDouble(modelo.getValueAt(0, 3).toString()));

            recibo.setCodigoServico(Integer.parseInt(txtCodigo.getText()));
            recibo.setDescrição(modelo.getValueAt(1, 0).toString());
            recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(1, 1).toString()));
            recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(1, 2).toString()));
            recibo.setSubtotal(Double.parseDouble(modelo.getValueAt(1, 3).toString()));
        } else if (modelo.getRowCount() == 3) {

            recibo.setCodigoServico(Integer.parseInt(txtCodigo.getText()));
            recibo.setDescrição(modelo.getValueAt(0, 0).toString());
            recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(0, 1).toString()));
            recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(0, 2).toString()));
            recibo.setSubtotal(Double.parseDouble(modelo.getValueAt(0, 3).toString()));

            recibo.setCodigoServico(Integer.parseInt(txtCodigo.getText()));
            recibo.setDescrição(modelo.getValueAt(1, 0).toString());
            recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(1, 1).toString()));
            recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(1, 2).toString()));
            recibo.setSubtotal(Double.parseDouble(modelo.getValueAt(1, 3).toString()));

            recibo.setCodigoServico(Integer.parseInt(txtCodigo.getText()));
            recibo.setDescrição(modelo.getValueAt(2, 0).toString());
            recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(2, 1).toString()));
            recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(2, 2).toString()));
            recibo.setSubtotal(Double.parseDouble(modelo.getValueAt(2, 3).toString()));
        }
        ReciboDAO dao = null;

        try {
            dao = new ReciboDAO();
            dao.addServicoRealizado(recibo);
            // se caso ocorrer um erro ele vai entrar no catch
        } catch (SQLException ex) {
            System.err.print(ex.getMessage());
            Logger.getLogger(ReciboSaida.class.getName()).log(Level.SEVERE, null, ex);
        }
        //fim adiciona
        //ativo e não ativo

}//GEN-LAST:event_btnGravarActionPerformed

    private void btnNaoGravarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNaoGravarActionPerformed
        txtCodigo.setText("");
        txtBairro.setText("");
        txtCelular.setText("");
        txtCidade.setText("");
        txtCliente.setText("");
        txtDataEntrada.setText("");
        txtDataSaida.setText("");
        txtEndereco.setText("");
        txtEquipamento.setText("");
        txtTelefone.setText("");
        txtCodigoCliente.setText("");
        //ativa e desativar botões
        btnNaoGravar.setEnabled(false);
        btnGravar.setEnabled(false);
        btnIncluir.setEnabled(true);
        btnLocalizar.setEnabled(true);
        btnImprimir.setEnabled(true);
        btnFechar.setEnabled(true);
        btnAdd.setEnabled(false);
        btnDelete.setEnabled(false);
        btnServico.setEnabled(false);
        //ativar e desativar campos
        txtBairro.setEnabled(false);
        txtCelular.setEnabled(false);
        txtCidade.setEnabled(false);
        txtCliente.setEnabled(false);
        txtCodigo.setEnabled(false);
        txtDataEntrada.setEnabled(false);
        txtDataSaida.setEnabled(false);
        txtEndereco.setEnabled(false);
        txtEquipamento.setEnabled(false);
        txtTelefone.setEnabled(false);
        txtTotal.setEnabled(false);
        txtTecnico.setEnabled(false);
        cBoxStatus.setEnabled(false);
        txtCodigoCliente.setEnabled(false);
        jTable1.setEnabled(false);

        //incluir uma linha para não causar um erro na instacia
        modelo.removeRow(0);
        modelo.addRow(new String[][]{});
}//GEN-LAST:event_btnNaoGravarActionPerformed

    private void btnImprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirActionPerformed
        GeradoRelatorios rep = new GeradoRelatorios();
        JasperPrint relat;
        try {
            relat = rep.gerarRelatoriosClientes();
            JasperViewer.viewReport(relat, false);
        } catch (Exception e) {
            e.printStackTrace();
        }
        //}
        ////para chama o relatorio funcionario no botão jmenuitem por um codigo
        //    private void menuitemFuncionariosActionPerformed(java.awt.event.ActionEvent evt) {
        //        GeradoRelatorios rep = new GeradoRelatorios();
        //        JasperPrint relat;
        //        try {
        //            int codigo = Integer.parseInt(JOptionPane.showInputDialog("informe o codigo"));
        //            relat = rep.gerarRelatoriosFuncionarios2(codigo);
        //            JasperViewer.viewReport(relat, false);
        //        } catch (Exception e) {
        //            e.printStackTrace();
        //        }
}//GEN-LAST:event_btnImprimirActionPerformed

    private void btnFecharActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFecharActionPerformed
        this.dispose();
}//GEN-LAST:event_btnFecharActionPerformed

    private void txtDataSaidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtDataSaidaActionPerformed
    }//GEN-LAST:event_txtDataSaidaActionPerformed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
    }//GEN-LAST:event_formWindowOpened

    private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddActionPerformed
        modelo.addRow(new String[][]{});

    }//GEN-LAST:event_btnAddActionPerformed

    private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteActionPerformed
        int linhaSelecionada = jTable1.getSelectedRow();
        modelo.removeRow(linhaSelecionada);
    }//GEN-LAST:event_btnDeleteActionPerformed

    private void cPesquisaServActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cPesquisaServActionPerformed
        modeloServ.setNumRows(0);

        try {
            ServicoDAO sDao = new ServicoDAO();
            ArrayList<Servico> servico = sDao.retornaServicoPorStatus(cPesquisaServ.getSelectedItem().toString());

            for (Servico s : servico) {
                modeloServ.addRow(new String[]{Integer.toString(s.getCodigoServico()), s.getStatus(), s.getEquipamento(), s.getAcessorio(), s.getDataHora(), s.getDataHSaida(), s.getNotaFiscal(), s.getDefeitoReclamar(), Integer.toString(s.getCodigoCliente()), s.getCliente(), s.getTecnicoResponsavel(), Double.toString(s.getTotal())});
            }
        } catch (SQLException ex) {
            ex.printStackTrace();

        }
}//GEN-LAST:event_cPesquisaServActionPerformed

    private void TabelaServMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TabelaServMouseClicked
        if (evt.getClickCount() == 2) {
            if (TabelaServ.getSelectedRow() != -1) {
                int linhaSelecionada = TabelaServ.getSelectedRow();

                txtCodigo.setText((modeloServ.getValueAt(linhaSelecionada, 0).toString()));
                cBoxStatus.setSelectedItem(modeloServ.getValueAt(linhaSelecionada, 1).toString());
                txtEquipamento.setText(modeloServ.getValueAt(linhaSelecionada, 2).toString());
                txtCodigoCliente.setText(modeloServ.getValueAt(linhaSelecionada, 8).toString());
                txtDataEntrada.setText(modeloServ.getValueAt(linhaSelecionada, 4).toString());// não entra!
                try {
                    ServicoDAO cDao = new ServicoDAO();
                    ArrayList<Cliente> cliente = cDao.retornaCamposPorCodigo(txtCodigoCliente.getText());
                    for (Cliente c : cliente) {
                        txtCliente.setText(c.getNome());
                        txtTelefone.setText(c.getFone1());
                        txtCelular.setText(c.getCelular());
                        txtEndereco.setText(c.getEndereco());
                        txtCidade.setText(c.getCidade());
                        txtBairro.setText(c.getBairro());
                    }
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }
                //colocar data e hora no campo de data e hora
                SimpleDateFormat dataf = new SimpleDateFormat("dd/MM/yyyy 'e' HH:mm:ss");
                data = new Date();
                txtDataSaida.setText(dataf.format(data));
//                if (btnLocalizar.getText().equals("Localizar")) {
//                    LocalizarServico.setVisible(true);
//                    dadosServico.setVisible(false);
//                    dadosServico2.setVisible(false);
//                    btnIncluir.setEnabled(false);
//                } else {
//                    btnLocalizar.setText("Localizar");
//                    dadosServico.setVisible(true);
//                    dadosServico2.setVisible(true);
//                    LocalizarServico.setVisible(false);
//                    btnIncluir.setEnabled(true);
//                }
                //ativar e desativar botões
                txtBairro.setEnabled(true);
                txtCelular.setEnabled(true);
                txtCidade.setEnabled(true);
                txtCliente.setEnabled(true);
                txtCodigo.setEnabled(false);
                txtDataEntrada.setEnabled(false);
                txtDataSaida.setEnabled(false);
                txtEndereco.setEnabled(true);
                txtEquipamento.setEnabled(true);
                txtTelefone.setEnabled(true);
                txtTotal.setEnabled(true);
                txtTecnico.setEnabled(true);
                cBoxStatus.setEnabled(true);
                jTable1.setEnabled(true);
                //Localizar.setVisible(false);
                btnGravar.setEnabled(true);
                btnExcluir.setEnabled(true);
                //btnGravar.setText("Atualizar");
                // ativar e desativar Painels
                LocalizarServico.setVisible(false);
                dadosServico.setVisible(true);
                dadosServico2.setVisible(true);
            }
        }

        int linhaSelecionada = TabelaServ.getSelectedRow();

        modeloServRealizado.setNumRows(0);
        try {
            ReciboDAO rDao = new ReciboDAO();
            ArrayList<Recibo> recibo = rDao.retornaServicoPorCodigo(Integer.parseInt(modeloServ.getValueAt(linhaSelecionada, 0).toString()));
            for (Recibo r : recibo) {
                modeloServRealizado.addRow(new String[]{r.getDescrição(), Double.toString(r.getValorUnitario()), Integer.toString(r.getQuantidade()), Double.toString(r.getSubtotal())});

            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
}//GEN-LAST:event_TabelaServMouseClicked

    private void TabelaServMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TabelaServMouseEntered
        // TODO add your handling code here:
}//GEN-LAST:event_TabelaServMouseEntered

    private void TabelaServMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TabelaServMousePressed
        // TODO add your handling code here:
}//GEN-LAST:event_TabelaServMousePressed

    private void jScrollPane4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jScrollPane4MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jScrollPane4MouseClicked

    private void txtPesquisaNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaNomeActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txtPesquisaNomeActionPerformed

    private void txtPesquisaNomeKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaNomeKeyReleased
        modeloServ.setNumRows(0);

        try {
            ServicoDAO sDao = new ServicoDAO();
            ArrayList<Servico> servico = sDao.retornaServicoPorNome(txtPesquisaNome.getText());

            for (Servico s : servico) {
                modeloServ.addRow(new String[]{Integer.toString(s.getCodigoServico()), s.getStatus(), s.getEquipamento(), s.getAcessorio(), s.getDataHora(), s.getDataHSaida(), s.getNotaFiscal(), s.getDefeitoReclamar(), Integer.toString(s.getCodigoCliente()), s.getCliente(), s.getTecnicoResponsavel(), Double.toString(s.getTotal())});
            }
        } catch (SQLException ex) {
            ex.printStackTrace();

        }
}//GEN-LAST:event_txtPesquisaNomeKeyReleased

    private void btnServicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnServicoActionPerformed
        dadosServico.setVisible(false);
        dadosServico2.setVisible(false);
        LocalizarServico.setVisible(true);
        btnIncluir.setEnabled(false);
    }//GEN-LAST:event_btnServicoActionPerformed

    private void jTable1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTable1KeyReleased

        recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(0, 1).toString()));
        recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(0, 2).toString()));
        recibo.setSubtotal(recibo.getValorUnitario() * recibo.getQuantidade());
        modelo.setValueAt(recibo.getSubtotal(), 0, 3);

        double total1 = recibo.getSubtotal();
        double totalFinal1 = total1;
        txtTotal.setText(Double.toString(totalFinal1));

        recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(1, 1).toString()));
        recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(1, 2).toString()));
        recibo.setSubtotal(recibo.getValorUnitario() * recibo.getQuantidade());
        modelo.setValueAt(recibo.getSubtotal(), 1, 3);

        double total2 = recibo.getSubtotal();
        double totalFinal2 = total1 + total2;
        txtTotal.setText(Double.toString(totalFinal2));

        recibo.setValorUnitario(Double.parseDouble(modelo.getValueAt(2, 1).toString()));
        recibo.setQuantidade(Integer.parseInt(modelo.getValueAt(2, 2).toString()));
        recibo.setSubtotal(recibo.getValorUnitario() * recibo.getQuantidade());
        modelo.setValueAt(recibo.getSubtotal(), 2, 3);

        double total3 = recibo.getSubtotal();
        double totalFinal3 = total1 + total2 + total3;
        txtTotal.setText(Double.toString(totalFinal3));

    }//GEN-LAST:event_jTable1KeyReleased

    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened
        // DIMENSÕES DA TELA
        // Recupera o tamanho da tela
        java.awt.Dimension screenSize =
                java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        // Ajusta o tamanho da janela (JFrame)
        setSize(new java.awt.Dimension(731, 672));
        // Ajusta a localização da janela, dependendo do tamanho da janela em
        // relação ao tamanho da tela
        setLocation((screenSize.width - 1000) / 2, (screenSize.height - 800) / 2);

        //ativar e desativar botões
        btnIncluir.setEnabled(true);
        btnLocalizar.setEnabled(true);
        btnExcluir.setEnabled(false);
        btnGravar.setEnabled(false);
        btnNaoGravar.setEnabled(false);
        btnImprimir.setEnabled(false);
        btnDelete.setEnabled(false);
        btnAdd.setEnabled(false);
        btnServico.setEnabled(false);
        //ativar e desativar campos
        txtBairro.setEnabled(false);
        txtCelular.setEnabled(false);
        txtCidade.setEnabled(false);
        txtCliente.setEnabled(false);
        txtCodigo.setEnabled(false);
        txtDataEntrada.setEnabled(false);
        txtDataSaida.setEnabled(false);
        txtEndereco.setEnabled(false);
        txtEquipamento.setEnabled(false);
        txtTelefone.setEnabled(false);
        txtTotal.setEnabled(false);
        txtTecnico.setEnabled(false);
        cBoxStatus.setEnabled(false);
        txtCodigoCliente.setEnabled(false);
        jTable1.setEnabled(false);
        // ativar e desativar Painels
        LocalizarServico.setVisible(false);

        //TABELA DE DADOS DE SERVIÇOS
        String[] colunas = new String[]{"Descrição", "Valor Unitário", "Quantidade", "Total"};
        String[][] dados = new String[][]{new String[]{""}};

        modelo = new DefaultTableModel(dados, colunas);
        jTable1.setModel(modelo);

        //TABELA DE BUSCA DE SERVIÇOS
        String[] colunas2 = new String[]{"", "", "", "", "", "", "", "", "", "", "", ""};
        String[][] dados2 = new String[][]{};


        modeloServ = new DefaultTableModel(dados2, colunas2) {

            public boolean isCellEditable(int row, int col) {
                return false;
            }
        };
        TabelaServ.setModel(modeloServ);
        TabelaServ.getTableHeader().getColumnModel().getColumn(0).setHeaderValue("Código");
        TabelaServ.getTableHeader().getColumnModel().getColumn(1).setHeaderValue("Status");
        TabelaServ.getTableHeader().getColumnModel().getColumn(2).setHeaderValue("Equipamento");
        TabelaServ.getTableHeader().getColumnModel().getColumn(3).setHeaderValue("Acessorios");
        TabelaServ.getTableHeader().getColumnModel().getColumn(4).setHeaderValue("Data e Hora da Entrada");
        TabelaServ.getTableHeader().getColumnModel().getColumn(5).setHeaderValue("Data e Hora da Saida");
        TabelaServ.getTableHeader().getColumnModel().getColumn(6).setHeaderValue("Nota Fiscal");
        TabelaServ.getTableHeader().getColumnModel().getColumn(7).setHeaderValue("Defeito a Reclamar");
        TabelaServ.getTableHeader().getColumnModel().getColumn(8).setHeaderValue("Cód. Cliente");
        TabelaServ.getTableHeader().getColumnModel().getColumn(9).setHeaderValue("Nome do Cliente");
        TabelaServ.getTableHeader().getColumnModel().getColumn(10).setHeaderValue("Tecnico Responsavel");
        TabelaServ.getTableHeader().getColumnModel().getColumn(11).setHeaderValue("Total");

        TabelaServ.getTableHeader().getColumnModel().getColumn(0).setMinWidth(10);
        TabelaServ.getTableHeader().getColumnModel().getColumn(1).setMinWidth(40);
        TabelaServ.getTableHeader().getColumnModel().getColumn(2).setMinWidth(80);
        TabelaServ.getTableHeader().getColumnModel().getColumn(3).setMinWidth(200);
        TabelaServ.getTableHeader().getColumnModel().getColumn(4).setMinWidth(130);
        TabelaServ.getTableHeader().getColumnModel().getColumn(5).setMinWidth(130);
        TabelaServ.getTableHeader().getColumnModel().getColumn(6).setMinWidth(40);
        TabelaServ.getTableHeader().getColumnModel().getColumn(7).setMinWidth(130);
        TabelaServ.getTableHeader().getColumnModel().getColumn(8).setMinWidth(30);
        TabelaServ.getTableHeader().getColumnModel().getColumn(9).setMinWidth(150);
        TabelaServ.getTableHeader().getColumnModel().getColumn(10).setMinWidth(100);
        TabelaServ.getTableHeader().getColumnModel().getColumn(11).setMinWidth(80);

        TabelaServ.setPreferredScrollableViewportSize(new Dimension(1700, 0));

        // retorna todos os serviços para a tabela modelo.
        try {
            ServicoDAO servicoDao = new ServicoDAO();
            ArrayList<Servico> servico = servicoDao.retornaTodosServicos();

            modeloServ.setNumRows(0);

            for (Servico s : servico) {
                // para inserir o codigo do cliente que faz parte de outro metodo na classeDao
                modeloServ.addRow(new String[]{Integer.toString(s.getCodigoServico()), s.getStatus(), s.getEquipamento(), s.getAcessorio(), s.getDataHora(), s.getDataHSaida(), s.getNotaFiscal(), s.getDefeitoReclamar(), Integer.toString(s.getCodigoCliente()), s.getCliente(), s.getTecnicoResponsavel(), Double.toString(s.getTotal())});
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }

        //TABELA DE BUSCA DE SERVIÇOS REALIZADO
        String[] colunas3 = new String[]{"Descrição", "Valor Unitário", "Quantidade", "Total"};
        String[][] dados3 = new String[][]{};


        modeloServRealizado = new DefaultTableModel(dados3, colunas3) {

            public boolean isCellEditable(int row, int col) {
                return false;
            }
        };
        TabelaServRealizado.setModel(modeloServRealizado);
        TabelaServRealizado.getTableHeader().getColumnModel().getColumn(0).setHeaderValue("Descrição");
        TabelaServRealizado.getTableHeader().getColumnModel().getColumn(1).setHeaderValue("Valor Unitário");
        TabelaServRealizado.getTableHeader().getColumnModel().getColumn(2).setHeaderValue("Quantidade");
        TabelaServRealizado.getTableHeader().getColumnModel().getColumn(3).setHeaderValue("SubTotal");

        TabelaServRealizado.getTableHeader().getColumnModel().getColumn(0).setMinWidth(70);
        TabelaServRealizado.getTableHeader().getColumnModel().getColumn(1).setMinWidth(20);
        TabelaServRealizado.getTableHeader().getColumnModel().getColumn(2).setMinWidth(20);
        TabelaServRealizado.getTableHeader().getColumnModel().getColumn(3).setMinWidth(30);

        TabelaServRealizado.setPreferredScrollableViewportSize(new Dimension(150, 0));

    }//GEN-LAST:event_formInternalFrameOpened

    private void TabelaServRealizadoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TabelaServRealizadoMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_TabelaServRealizadoMouseClicked

    private void TabelaServRealizadoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TabelaServRealizadoMouseEntered
        // TODO add your handling code here:
    }//GEN-LAST:event_TabelaServRealizadoMouseEntered

    private void TabelaServRealizadoMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TabelaServRealizadoMousePressed
        // TODO add your handling code here:
    }//GEN-LAST:event_TabelaServRealizadoMousePressed

    private void jScrollPane6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jScrollPane6MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jScrollPane6MouseClicked
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel LocalizarServico;
    private javax.swing.JTable TabelaServ;
    private javax.swing.JTable TabelaServRealizado;
    private javax.swing.JButton btnAdd;
    private javax.swing.JButton btnDelete;
    private javax.swing.JButton btnExcluir;
    private javax.swing.JButton btnFechar;
    private javax.swing.JButton btnGravar;
    private javax.swing.JButton btnImprimir;
    private javax.swing.JButton btnIncluir;
    private javax.swing.JButton btnLocalizar;
    private javax.swing.JButton btnNaoGravar;
    private javax.swing.JButton btnServico;
    private javax.swing.JComboBox cBoxStatus;
    private javax.swing.JComboBox cPesquisaServ;
    private javax.swing.JPanel dadosServico;
    private javax.swing.JPanel dadosServico2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField txtBairro;
    private javax.swing.JTextField txtCelular;
    private javax.swing.JTextField txtCidade;
    private javax.swing.JTextField txtCliente;
    private javax.swing.JFormattedTextField txtCodigo;
    private javax.swing.JTextField txtCodigoCliente;
    private javax.swing.JTextField txtDataEntrada;
    private javax.swing.JTextField txtDataSaida;
    private javax.swing.JTextField txtEndereco;
    private javax.swing.JTextField txtEquipamento;
    private javax.swing.JTextField txtPesquisaNome;
    private javax.swing.JTextField txtTecnico;
    private javax.swing.JTextField txtTelefone;
    private javax.swing.JTextField txtTotal;
    // End of variables declaration//GEN-END:variables

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                // comando que bota um tema no jFrame.
                try {
                    UIManager.setLookAndFeel(new SubstanceBusinessLookAndFeel());
                    SubstanceLookAndFeel.setSkin(new OfficeSilver2007Skin());
                } catch (UnsupportedLookAndFeelException ex) {
                    ex.printStackTrace();
                }
                new ReciboSaida().setVisible(true);
            }
        });
    }
}
